<%@ page language="java" import="java.util.*,cs.sy.service.bean.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'food.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
	<script type="text/javascript">
		function orderfood(){
			var foodname = $("input[name='foodname']:checked").val();
			location.href="orderfood?foodname="+foodname;
		}
	</script>
  </head>
  
  <body>
  <%List<FoodBean> foodBeans = (List<FoodBean>)request.getAttribute("food"); %>
  	<center><a href="shopservlet?shopname=一招鲜">一招鲜面分馆</a> vs <a href="shopservlet?shopname=煨汤盖码饭">煨汤盖码饭</a> -- <font color="red">订餐时间 每日11点30之前</font></center>
  	<%if(request.getAttribute("result") != null){ %>
  	<center><font color="red">${result }</font></center>	
  	<%} %>
  	<table border="1" align="center">
  		<%for(int i=0;i<foodBeans.size();i++){ %>
  		<tr>
  			<td>【<font color='red'><%=foodBeans.get(i).getShop_name() %></font>】</td>
  			<td><%=foodBeans.get(i).getFood_name() %>[<%=foodBeans.get(i).getFood_price() %>元]</td>
  			<td><input type="radio" name="foodname" <%if(i == 0){ %>checked<%} %> value="<%=foodBeans.get(i).getU_id() %>" /></td>
  		</tr>
  		<%} %>
  		<tr>
  			<td colspan="2"><input type="button" value="订餐" onclick="orderfood();" /></td>
  			<td><a href="/perfectfood">返回</a></td>
  		</tr>
  	</table>
  </body>
</html>
